group { name: "e/widgets/button";
   images.image: "win_shadow.png" COMP;
   parts {
      part { name: "shadow"; mouse_events: 0;
         scale: 1;
         description { state: "default" 0.0;
            rel.to: "base";
            WIN_SHADOW_SMALL;
            color_class: "/shadow/normal/button";
         }
         description { state: "clicked" 0.0;
            inherit;
            image.border_scale_by: 0.25;
            rel1.offset: -2 -1;
            rel2.offset: 0 1;
            offscale;
            color_class: "/shadow/pressed/button";
         }
      }
      rect { "base";
         scale: 1;
         desc { "default";
            color_class: "/bg/normal/button";
            rel1.offset: 2 2;
            rel2.offset: -3 -3;
            offscale;
         }
         desc { "clicked"; inherit;
            color_class: "/bg/pressed/button";
         }
         desc { "disabled"; inherit;
            color_class: "/bg/disabled/button";
         }
      }
      part { name: "icon_clip"; type: RECT;
         description { state: "default" 0.0;
            color: 255 255 255 255; // no cc
         }
         description { state: "disabled" 0.0;
            inherit: "default" 0.0;
            color: 255 255 255 64; // no cc
         }
      }
      part { name: "e.swallow.icon"; type: SWALLOW; mouse_events: 0;
         clip_to: "icon_clip";
         scale: 1;
         desc { "default";
            fixed: 1 0;
            align: 0.0 0.5;
            rel.to: "base";
            rel1.offset: 0 4;
            rel2.relative: 0.0 1.0;
            rel2.offset: -1 -5;
            visible: 0;
            max: 0 999999;
            offscale;
         }
         desc { "combo"; inherit;
            fixed: 1 0;
            rel1.offset: 4 4;
            rel2.relative: 0.0 1.0;
            rel2.offset: 4 -5;
            aspect: 1.0 1.0; aspect_preference: VERTICAL;
            visible: 1;
            min: ICMIN ICMIN;
         }
         description { state: "icon" 0.0;
            fixed: 0 0;
            align: 0.5 0.5;
            rel1.offset: 4 4;
            rel2.relative: 1.0 1.0;
            rel2.offset: -5 -5;
            visible: 1;
            min: ICMIN ICMIN;
         }
      }
      part { name: "label_clip"; type: RECT;
         description { state: "default" 0.0;
         }
         description { state: "disabled" 0.0;
            inherit: "default" 0.0;
            visible: 0;
         }
      }
      part { name: "e.text.label"; type: TEXT; mouse_events: 0;
         scale: 1;
         clip_to: "label_clip";
         description { state: "default" 0.0;
            fixed: 0 0;
            color_class: "/fg/normal/button";
            rel1.offset: 4 4;
            rel1.relative: 1.0 0.0;
            rel1.to_x: "e.swallow.icon";
            rel1.to_y: "base";
            rel2.to: "base";
            rel2.offset: -5 -5;
            text { font: FN; size: 10;
               align: 0.5 0.5;
               min: 1 1;
               ellipsis: -1;
            }
            offscale;
            min: 0 ICMIN;
         }
         description { state: "disabled" 0.0;
            inherit: "default" 0.0;
            color_class: "/fg/disabled/button";
         }
         description { state: "combo" 0.0;
            inherit: "default" 0.0;
         }
         description { state: "icon" 0.0;
            inherit: "default" 0.0;
            visible: 0;
         }
         description { state: "clicked" 0.0;
            inherit: "default" 0.0;
            color_class: "/fg/pressed/button";
         }
      }
      part { name: "event"; type: RECT;
         ignore_flags: ON_HOLD;
         description { state: "default" 0.0;
            rel.to: "base";
            color: 0 0 0 0; // no cc
         }
         description { state: "disabled" 0.0;
            inherit: "default" 0.0;
            visible: 0;
         }
      }
   }
   programs {
      program {
         signal: "mouse,down,1"; source: "event";
         action: STATE_SET "clicked" 0.0;
         target: "shadow";
         target: "base";
         target: "e.text.label";
      }
      program {
         signal: "mouse,up,1"; source: "event";
         action: STATE_SET "default" 0.0;
         target: "shadow";
         target: "base";
         target: "e.text.label";
      }
      program {
         signal: "mouse,clicked,1*"; source: "event";
         action: SIGNAL_EMIT "e,action,click" "";
      }
      program {
         signal: "e,state,text"; source: "e";
         action: STATE_SET "default" 0.0;
         target: "e.swallow.icon";
         target: "e.text.label";
      }
      program {
         signal: "e,state,icon"; source: "e";
         action: STATE_SET "icon" 0.0;
         target: "e.swallow.icon";
         target: "e.text.label";
      }
      program {
         signal: "e,state,combo"; source: "e";
         action: STATE_SET "combo" 0.0;
         target: "e.swallow.icon";
         target: "e.text.label";
      }
      program {
         signal: "e,state,disabled"; source: "e";
         action: STATE_SET "disabled" 0.0;
         target: "event";
         target: "base";
         target: "icon_clip";
         target: "e.text.label";
      }
      program {
         signal: "e,state,enabled"; source: "e";
         action: STATE_SET "default" 0.0;
         target: "event";
         target: "base";
         target: "icon_clip";
         target: "e.text.label";
      }
   }
}
